<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        $(function () {
            var $div = $('.box');
            //盒子内容的真实尺寸
            console.log($div.width());
            console.log($div.height());

            //盒子内容加上 padding的尺寸
            console.log($div.innerWidth());
            console.log($div.innerHeight());

            //盒子的真实尺寸: 内容尺寸 + padding + border
            console.log($div.outerWidth());
            console.log($div.outerHeight());

            //盒子的真实尺寸 加上 margin 的尺寸
            console.log($div.outerWidth(true));
            console.log($div.outerHeight(true));



        });
    </script>
    <style type="text/css">
        .box {
            width: 200px;
            height: 200px;
            padding: 20px;
            border: 10px solid #000000;
            margin: 20px;
            background-color: gold;
        }
    </style>
    <title>Document</title>
</head>

<body>
    <div class="box"></div>

</body>

</html>